From 5ff9316ec27c1e92baa1cefbb5d5531f736dd09a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 22 Oct 2023 16:19:31 -0400 Subject: [PATCH] gsk: Restore bigendian support Restore the bigendian support that was lost in b0e26873f66a8f52, by just not using GL_BGRA with GLES on bigendian. Should be a very rare combination, but still. --- gsk/gl/gskglglyphlibrary.c | 6 +++++- gsk/gl/gskgliconlibrary.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gsk/gl/gskglglyphlibrary.c b/gsk/gl/gskglglyphlibrary.c index 3c04b46973..2e6d4da7fb 100644 --- a/gsk/gl/gskglglyphlibrary.c +++ b/gsk/gl/gskglglyphlibrary.c @@ -119,7 +119,11 @@ gsk_gl_glyph_library_init_atlas (GskGLTextureLibrary *self, memset (pixel_data, 255, sizeof pixel_data); - if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())) + if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ()) +#if G_BYTE_ORDER == G_BIG_ENDIAN + || gdk_gl_context_get_use_es (gdk_gl_context_get_current ()) +#endif + ) { gl_format = GL_RGBA; gl_type = GL_UNSIGNED_BYTE; diff --git a/gsk/gl/gskgliconlibrary.c b/gsk/gl/gskgliconlibrary.c index 156469dde0..e57016a1a2 100644 --- a/gsk/gl/gskgliconlibrary.c +++ b/gsk/gl/gskgliconlibrary.c @@ -111,7 +111,11 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self, gdk_gl_context_push_debug_group_printf (gdk_gl_context_get_current (), "Uploading texture"); - if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ())) + if (!gdk_gl_context_has_bgra (gdk_gl_context_get_current ()) +#if G_BYTE_ORDER == G_BIG_ENDIAN + || gdk_gl_context_get_use_es (gdk_gl_context_get_current ()) +#endif + ) { pixel_data = free_data = g_malloc (width * height * 4); gdk_memory_convert (pixel_data, width * 4, -- 2.30.2